//*********************************************************
//
// Copyright (c) Microsoft. All rights reserved.
// This code is licensed under the MIT License (MIT).
// THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
// IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
// PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
//
//*********************************************************
//-----------------------------------------------------------------------------
// <auto-generated>
//   This code was generated by a tool.
//
//   Changes to this file may cause incorrect behavior and will be lost if
//   the code is regenerated.
//
//   For more information, see: http://go.microsoft.com/fwlink/?LinkID=623246
// </auto-generated>
//-----------------------------------------------------------------------------
#pragma once

namespace com { namespace microsoft { namespace Samples { namespace SecureInterface {

ref class SecureInterfaceLegacySignals;

public interface class ISecureInterfaceLegacySignals
{
    event Windows::Foundation::TypedEventHandler<SecureInterfaceLegacySignals^, SecureInterfaceTextSentReceivedEventArgs^>^ TextSentReceived;
};

public ref class SecureInterfaceLegacySignals sealed : [Windows::Foundation::Metadata::Default] ISecureInterfaceLegacySignals
{
public:
    // "This signal is emitted when producer sends a text message to consumer"
    // Calling this method will send the TextSent signal to every member of the session.
    void TextSent(_In_ Platform::String^ interfaceMemberMessage);

    // This event fires whenever the TextSent signal is sent by another member of the session.
    virtual event Windows::Foundation::TypedEventHandler<SecureInterfaceLegacySignals^, SecureInterfaceTextSentReceivedEventArgs^>^ TextSentReceived 
    { 
        Windows::Foundation::EventRegistrationToken add(Windows::Foundation::TypedEventHandler<SecureInterfaceLegacySignals^, SecureInterfaceTextSentReceivedEventArgs^>^ handler) 
        { 
            return _TextSentReceived += ref new Windows::Foundation::EventHandler<Platform::Object^>
            ([handler](Platform::Object^ sender, Platform::Object^ args)
            {
                handler->Invoke(safe_cast<SecureInterfaceLegacySignals^>(sender), safe_cast<SecureInterfaceTextSentReceivedEventArgs^>(args));
            }, Platform::CallbackContext::Same);
        } 
        void remove(Windows::Foundation::EventRegistrationToken token) 
        { 
            _TextSentReceived -= token; 
        } 
    internal: 
        void raise(SecureInterfaceLegacySignals^ sender, SecureInterfaceTextSentReceivedEventArgs^ args) 
        { 
            _TextSentReceived(sender, args);
        } 
    }

internal:
    void Initialize(_In_ alljoyn_busobject busObject, _In_ alljoyn_sessionid sessionId);
    void CallTextSentReceived(_In_ SecureInterfaceLegacySignals^ sender, _In_ SecureInterfaceTextSentReceivedEventArgs^ args);

private:
    alljoyn_busobject m_busObject;
    alljoyn_sessionid m_sessionId;

    virtual event Windows::Foundation::EventHandler<Platform::Object^>^ _TextSentReceived;

    alljoyn_interfacedescription_member m_memberTextSent;
};

} } } } 